package com.chookss.home.audit.adapter;

import android.content.Context;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.chookss.R;
import com.chookss.home.entity.PaySlipEntity;
import com.chookss.tools.ClearMoreZeroUtil;
import com.chookss.tools.Utils;

import java.util.List;

import io.reactivex.annotations.Nullable;

public class PaySlipAdapter extends BaseQuickAdapter<PaySlipEntity.TitleInfoBean, BaseViewHolder> {
   private Context context;
    public PaySlipAdapter(int layoutResId, Context context, @Nullable List<PaySlipEntity.TitleInfoBean> data) {
        super(layoutResId, data);
        this.context=context;
    }

    @Override
    protected void convert(BaseViewHolder helper, PaySlipEntity.TitleInfoBean item) {
        TextView tvName = helper.getView(R.id.tvName);
        TextView tvData = helper.getView(R.id.tvData);
        tvName.setText(item.getTitleName());
        if(Utils.isNull(item.getTitleValue())){
            tvData.setText("无");
        }else{
            tvData.setText(ClearMoreZeroUtil.subZeroAndDot(item.getTitleValue())+"");
        }

    }
}
